package org.example.Swing.handler;

import org.example.Swing.xiangmu.login.LoginView;
import org.example.Swing.xiangmu.login.MainStuView;
import org.example.Swing.xiangmu.login.MainView;


import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


public class MainStuHandler implements ActionListener {
    private MainStuView mainStuView;
    public MainStuHandler(MainStuView mainStuView) {
        this.mainStuView = mainStuView;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        JButton jButton = (JButton) e.getSource();
        String text = jButton.getText();
        if  ("查询".equals(text)) {
        } else if ("上一页".equals(text)) {
            mainStuView.dispose();
            new MainView();
        } else if ("下一页".equals(text)) {
            mainStuView.dispose();
            new MainView();
        }

    }

    public void fanhui() {
        mainStuView.dispose();
        new LoginView();
    }
}